package nc.vo.medpub.pub.tooltip;

import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;

public class TipKeyInfoVO {

	private boolean isShow = true;
	private String keyCode;
	private String keyName;
	
	public TipKeyInfoVO() {
		super();
	}

	public TipKeyInfoVO(boolean isShow, String keyCode, String keyName) {
		super();
		this.isShow = isShow;
		this.keyCode = keyCode;
		this.keyName = keyName;
	}

	public boolean isShow() {
		return isShow;
	}

	public void setShow(boolean isShow) {
		this.isShow = isShow;
	}

	public String getKeyCode() {
		return keyCode;
	}

	public void setKeyCode(String keyCode) {
		this.keyCode = keyCode;
	}

	public String getKeyName() {
		return keyName;
	}

	public void setKeyName(String keyName) {
		this.keyName = keyName;
	}
	
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer("{");
		try {
			BeanInfo bi = Introspector.getBeanInfo(this.getClass());
			PropertyDescriptor[] props = bi.getPropertyDescriptors();
			for (int i = 0; i < props.length; i++) {
				sb.append(props[i].getName());
				sb.append(" = ");
				sb.append(props[i].getReadMethod().invoke(this));
				sb.append("\n");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		sb.append("}");
		return sb.toString();
	} 

}
